package com.disys.facade;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import com.disys.dao.Rec290empltaxcrdtDAO;
import com.disys.model.Rec220emplpaydtl;
import com.disys.model.Rec290empltaxcrdt;

public class Rec290empltaxcrdtFacade {

	private Rec290empltaxcrdtDAO obj = new Rec290empltaxcrdtDAO();

	public List<Rec290empltaxcrdt> findAllRecords() {
		List<Rec290empltaxcrdt> list = null;
		try {
			obj.beginTransaction();
			list = obj.findAll();
			obj.closeTransaction();
		} catch (IllegalStateException ex) {
			list = obj.findAll();
			obj.closeTransaction();
		}
		if (list.size() == 0 || list == null) {
			return new ArrayList<Rec290empltaxcrdt>();
		}
		return list;
	}

	public List<Rec290empltaxcrdt> findFinalizeRecords(String object,
			Integer isFinalized, BigInteger pId) {
		// obj.beginTransaction();
		List<Rec290empltaxcrdt> list = obj.findFinalizeRecords(object,
				isFinalized,pId);
		// obj.closeTransaction();
		if (list.size() == 0 || list == null) {
			return new ArrayList<Rec290empltaxcrdt>();
		}
		return list;
	}

	public void insertRecord(Rec290empltaxcrdt entity) {
		// obj.beginTransaction();
		obj.save(entity);
		// obj.commitAndCloseTransaction();
	}

	public List<Integer> getAllProcessIds(String object) {
		obj.beginTransaction();
		List<Integer> list = obj.getAllProcessIds(object);
		obj.closeTransaction();
		return list;
	}
	
	public Rec290empltaxcrdtFacade() {
	
	}

}
